home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_gen
/
t4diblib.zip
/
ANIMATE4.F4_
/
ANIMATE4.F4
Wrap
Text File
|
1995-12-11
|
4KB
|
135 lines
VERSION 4.00
Begin VB.Form Form1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "ANIMATE4"
ClientHeight = 1896
ClientLeft = 2628
ClientTop = 2688
ClientWidth = 2988
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 7.8
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 2316
Left = 2580
LinkTopic = "Form1"
ScaleHeight = 1896
ScaleWidth = 2988
Top = 2316
Width = 3084
Begin VBX.T4DILIB dilib2
Caption = "dilib2"
ControlMode = 1 'Lib -> DIB
Height = 384
Left = 1680
Top = 720
Visible = 0 'False
Width = 972
End
Begin VBX.T4DILIB dilib3
Caption = "dilib3"
ControlMode = 3 'DIB -> PIC
Height = 372
Left = 1680
Top = 1200
Visible = 0 'False
Width = 972
End
Begin VB.CommandButton Command1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "&Quit"
Height = 372
Left = 120
TabIndex = 0
Top = 1200
Width = 1452
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 372
Left = 120
Stretch = -1 'True
Top = 120
Width = 372
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GlobalFree% Lib "kernel" (ByVal h%)
Private Declare Function GetFreeSpace& Lib "kernel" (ByVal x%)
Dim TimeIn!
Dim Frames%
Private Sub Command1_Click()
Terminate
End Sub
Private Sub Form_Load()
Dim loopctr%, memctr%
Dim imwidth!, imheight!, imhwratio!
Dim memret%, hDib%
Top = (Screen.Height - Height) / 2!
Left = (Screen.Width - Width) / 2!
dilib2.LibraryName = "bluespin.ilb"
dilib2.Action = IM_ACTION_OPENLIBRARY
Show
hDib = 0 'Safety pays
Frames = 0
TimeIn = Timer
For loopctr = 1 To 100
For memctr = 1 To dilib2.MemberCount
'Disregard these comments for tutorial.
'Moving image
'image1.Left = image1.Left + screen.TwipsPerPixelX
'image1.Top = image1.Top + screen.TwipsPerPixelY
dilib2.MemberNumber = memctr
imwidth = dilib2.PixelWidth
imheight = dilib2.PixelHeight
imhwratio = imheight / imwidth
image1.Height = imhwratio * image1.Width
'If we have an hDib from a previous call, free it.
If hDib <> 0 Then
memret = GlobalFree(hDib)
End If
'Get the DIB from the library
dilib2.Action = IM_ACTION_GETMEMBER
'Save the hDib for freeing later.
hDib = dilib2.hDib
'Send the hDib to dilib3 for transformation.
dilib3.hDib = hDib
'Put the PIC in image1.
image1.Picture = dilib3.Picture
image1.Refresh
Frames = Frames + 1
Next memctr
DoEvents
Next loopctr
Terminate
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub Terminate()
Dim TimeOut!, TimeElapsed!, fps!
TimeOut = Timer
TimeElapsed = TimeOut - TimeIn
fps = Frames
fps = Frames / TimeElapsed
MsgBox Trim$(Str$(fps)) + " frames per second."
End
End Sub